package dy.com.tcp结合udp.Server;

import dy.com.tcp结合udp.constants.TCPConstants;

import java.io.IOException;

public class Server {
    public static void main(String[] args) {
        //开启TCP监听
        TCPServer tcpServer = new TCPServer(TCPConstants.TCP_PORT_SERVER);
        try {
            tcpServer.start();
        } catch (IOException e) {
            System.out.println("tcp监听开启失败");
            return;
        }

        //开启udp监听
        UDPServerProvider.start(TCPConstants.TCP_PORT_SERVER);
        try {
            System.in.read();
        } catch (IOException e) {
            e.printStackTrace();
        }
        UDPServerProvider.stop();
    }
}
